#include<bits/stdc++.h>
using namespace  std;
int main()
{
    string str;
    getline(cin, str);
    vector<string>ret;
    int begin = 0;
    while (begin < str.size())
    {
        auto pos = str.find(' ',begin);
        if (pos == std::string::npos)
        {
            ret.push_back(str.substr(begin));
            break;
        }
        if (pos - begin >= 1)
        {
            ret.push_back(str.substr(begin, pos - begin));
        }
        begin = pos + 1;
    }
    for (int i = ret.size() - 1; i >= 0; i--)
    {
        cout << ret[i] << " ";
    }
    return 0;
}